import * as React from 'react';
import Header from '@/commonComponents/header/Header';
import useAuth from '@/utils/hooks/useAuth';
import OrderStatus from './components/orderStatus/orderStatus';
import OrderInfo from './components/orderInfo/orderInfo';
import OrderOther from './components/orderOther/orderOther';
import BottomButton from './components/bottomButton/bottomButton';
import './index.module.scss';
import { useSearchParams } from 'react-router-dom';
// import type { orderDataProps } from './types';
const { memo } = React;
function OrderDetail() {
  // const token = localSto
  // const [show, setShow] = useState(false);
  const { back } = useAuth();
  const [params] = useSearchParams();
  // const orderId = params.get('orderId');
  const boxShow = params.get('boxShow');
  const orderStatus = Number(params.get('orderStatus'));
  const orderData = {
    dbAuftragsnummer: '123123123',
    startDate: '03月15日',
    endDate: '03月15日',
    startWeek: '周五',
    endWeek: '周五',
    startTime: '07:00',
    endTime: '11:29',
    startStation: '北京南',
    endStation: '上海虹桥',
    trainNumber: 'G157',
    booker: '张一诺',
    seatType: '一等座',
    ticketPrice: '200',
    idcard: '410323199**********56',
    carriag: '02',
    seatNumber: '16A',
    seatPlace: 1, //1靠窗2过道
    orderStatus: 2, //1已完成2待支付3已退款4已取消
    orderNumber: '76574574456465465',
    phoneNumber: '15738759163',
    ticketType: 1, //1成人票2学生票
    totalPrice: '400',
    ticketCount: 2,
    orderCreatTime: '2022-08-26 15:16:56',
  };

  return (
    <div styleName="servies-box">
      <Header
        title={`订单详情`}
        onBack={back}
        style={{
          background: '#1ba9ba',
          color: '#fff',
        }}
        type={3}
      />
      <div styleName="order-content">
        {boxShow == 'true' ? (
          <OrderStatus
            orderStatus={orderStatus}
            orderCreatTime={orderData.orderCreatTime}
          />
        ) : (
          ''
        )}
        <OrderInfo orderData={orderData} />
        <OrderOther orderData={orderData} />
      </div>
      {orderStatus != 1 ? <BottomButton orderStatus={orderStatus} /> : ''}
      {/* 
      <div styleName="Servies-box-con">
        <Nav
          date={departDate}
          isPrevDisabled={isPrevDisabled}
          isNextDisabled={isNextDisabled}
          prev={prev}
          next={next}
        />
        <List list={trains} />
      </div>
      <Bottom highSpeed={highSpeed}></Bottom> */}
    </div>
  );
}

export default memo(OrderDetail);
